package com.xggstudio.crm.ui.mvp.v.pop;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.xggstudio.crm.R;
import com.xggstudio.crm.ui.mvp.v.adapter.BaseCommonAdapter;
import com.xggstudio.crm.ui.mvp.v.adapter.CommonAdapter;
import com.xggstudio.crm.ui.mvp.v.adapter.ViewHolder;

import java.util.ArrayList;
import java.util.List;

public class CusTypePopWindow extends BasePopWindow {

    private RecyclerView list;

    private BaseCommonAdapter adapter;

    public CusTypePopWindow(Context context ,View v) {
        super(context,v);
    }

    @Override
    protected int getLayout() {
        return R.layout.popwindow_cus_type;
    }

    @Override
    protected void init(Context context,View v) {

        list = view.findViewById(R.id.list);


        List<String> data = new ArrayList<>();

        data.add("所有");
        data.add("留学");
        data.add("移民");
        data.add("房产");
        data.add("龟龟伙伴");

        adapter = new BaseCommonAdapter<String>(context,R.layout.view_text,data) {

            @Override
            public void convert(ViewHolder holder, String s, int position) {

                holder.setText(R.id.text,s);

                holder.setOnClickListener(R.id.layout, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {

                    }
                });

            }
        };

        list.setLayoutManager(new LinearLayoutManager(context));
        list.setAdapter(adapter);


       // showAsDropDown(v,0,0);

    }


}
